package com.quasar.hpatient.view.adapter;

import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.quasar.hpatient.R;
import com.quasar.hpatient.model.custommodel.TestTable;
import com.quasar.hpatient.model.custommodel.TestTableItem;

import java.util.List;

/**
 * author : 许建宏
 * Date: 2017/10/24 0024
 * View:
 */

public class TestTableAdapter extends BaseSectionQuickAdapter<TestTable, BaseViewHolder> {

    public TestTableAdapter(int layoutResId, int sectionHeadResId, List<TestTable> data) {
        super(layoutResId, sectionHeadResId, data);
    }

    //头布局
    @Override
    protected void convertHead(BaseViewHolder helper, TestTable item) {
        helper.setText(R.id.title, item.header);//item.header
    }

    //子布局
    @Override
    protected void convert(BaseViewHolder helper, TestTable item) {
        TestTableItem tableItem = item.t;
        helper.setText(R.id.title, tableItem.name);//item.header
        helper.setText(R.id.msg, tableItem.val + "");
        helper.setText(R.id.msgcheck, tableItem.msgcheck + "");
        helper.setText(R.id.demo, tableItem.Company);
    }
}
